\(\int (a+b \log (c (d+e x)^n)) (f+g \log (c (d+e x)^n)) \, dx\) [381]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [A] (verification not implemented)
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 29, antiderivative size = 110 \[ \int \left (a+b \log \left (c (d+e x)^n\right )\right ) \left (f+g \log \left (c (d+e x)^n\right )\right ) \, dx=-((b f+a g) n x)+2 b g n^2 x-\frac {2 b g n (d+e x) \log \left (c (d+e x)^n\right )}{e}+x \left (a+b \log \left (c (d+e x)^n\right )\right ) \left (f+g \log \left (c (d+e x)^n\right )\right )+\frac {d \left (b f+a g+2 b g \log \left (c (d+e x)^n\right )\right )^2}{4 b e g} \]

[Out]

-(a*g+b*f)*n*x+2*b*g*n^2*x-2*b*g*n*(e*x+d)*ln(c*(e*x+d)^n)/e+x*(a+b*ln(c*(e*x+d)^n))*(f+g*ln(c*(e*x+d)^n))+1/4
*d*(b*f+a*g+2*b*g*ln(c*(e*x+d)^n))^2/b/e/g

Rubi [A] (verified)

Time = 0.12 (sec) , antiderivative size = 110, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.172, Rules used = {2478, 2458, 2388, 2338, 2332} \[ \int \left (a+b \log \left (c (d+e x)^n\right )\right ) \left (f+g \log \left (c (d+e x)^n\right )\right ) \, dx=\frac {d \left (a g+2 b g \log \left (c (d+e x)^n\right )+b f\right )^2}{4 b e g}+x \left (a+b \log \left (c (d+e x)^n\right )\right ) \left (g \log \left (c (d+e x)^n\right )+f\right )-n x (a g+b f)-\frac {2 b g n (d+e x) \log \left (c (d+e x)^n\right )}{e}+2 b g n^2 x \]

[In]

Int[(a + b*Log[c*(d + e*x)^n])*(f + g*Log[c*(d + e*x)^n]),x]

[Out]

-((b*f + a*g)*n*x) + 2*b*g*n^2*x - (2*b*g*n*(d + e*x)*Log[c*(d + e*x)^n])/e + x*(a + b*Log[c*(d + e*x)^n])*(f
+ g*Log[c*(d + e*x)^n]) + (d*(b*f + a*g + 2*b*g*Log[c*(d + e*x)^n])^2)/(4*b*e*g)

Rule 2332

Int[Log[(c_.)*(x_)^(n_.)], x_Symbol] :> Simp[x*Log[c*x^n], x] - Simp[n*x, x] /; FreeQ[{c, n}, x]

Rule 2338

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))/(x_), x_Symbol] :> Simp[(a + b*Log[c*x^n])^2/(2*b*n), x] /; FreeQ[{a
, b, c, n}, x]

Rule 2388

Int[(((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))^(p_.)*((d_) + (e_.)*(x_))^(q_.))/(x_), x_Symbol] :> Dist[d, Int[(d
+ e*x)^(q - 1)*((a + b*Log[c*x^n])^p/x), x], x] + Dist[e, Int[(d + e*x)^(q - 1)*(a + b*Log[c*x^n])^p, x], x] /
; FreeQ[{a, b, c, d, e, n}, x] && IGtQ[p, 0] && GtQ[q, 0] && IntegerQ[2*q]

Rule 2458

Int[((a_.) + Log[(c_.)*((d_) + (e_.)*(x_))^(n_.)]*(b_.))^(p_.)*((f_.) + (g_.)*(x_))^(q_.)*((h_.) + (i_.)*(x_))
^(r_.), x_Symbol] :> Dist[1/e, Subst[Int[(g*(x/e))^q*((e*h - d*i)/e + i*(x/e))^r*(a + b*Log[c*x^n])^p, x], x,
d + e*x], x] /; FreeQ[{a, b, c, d, e, f, g, h, i, n, p, q, r}, x] && EqQ[e*f - d*g, 0] && (IGtQ[p, 0] || IGtQ[
r, 0]) && IntegerQ[2*r]

Rule 2478

Int[((a_.) + Log[(c_.)*((d_) + (e_.)*(x_))^(n_.)]*(b_.))*((f_.) + Log[(c_.)*((d_) + (e_.)*(x_))^(n_.)]*(g_.)),
 x_Symbol] :> Simp[x*(a + b*Log[c*(d + e*x)^n])*(f + g*Log[c*(d + e*x)^n]), x] - Dist[e*n, Int[(x*(b*f + a*g +
 2*b*g*Log[c*(d + e*x)^n]))/(d + e*x), x], x] /; FreeQ[{a, b, c, d, e, f, g, n}, x]

Rubi steps \begin{align*} \text {integral}& = x \left (a+b \log \left (c (d+e x)^n\right )\right ) \left (f+g \log \left (c (d+e x)^n\right )\right )-(e n) \int \frac {x \left (b f+a g+2 b g \log \left (c (d+e x)^n\right )\right )}{d+e x} \, dx \\ & = x \left (a+b \log \left (c (d+e x)^n\right )\right ) \left (f+g \log \left (c (d+e x)^n\right )\right )-n \text {Subst}\left (\int \frac {\left (-\frac {d}{e}+\frac {x}{e}\right ) \left (b f+a g+2 b g \log \left (c x^n\right )\right )}{x} \, dx,x,d+e x\right ) \\ & = x \left (a+b \log \left (c (d+e x)^n\right )\right ) \left (f+g \log \left (c (d+e x)^n\right )\right )-\frac {n \text {Subst}\left (\int \left (b f+a g+2 b g \log \left (c x^n\right )\right ) \, dx,x,d+e x\right )}{e}+\frac {(d n) \text {Subst}\left (\int \frac {b f+a g+2 b g \log \left (c x^n\right )}{x} \, dx,x,d+e x\right )}{e} \\ & = -((b f+a g) n x)+x \left (a+b \log \left (c (d+e x)^n\right )\right ) \left (f+g \log \left (c (d+e x)^n\right )\right )+\frac {d \left (b f+a g+2 b g \log \left (c (d+e x)^n\right )\right )^2}{4 b e g}-\frac {(2 b g n) \text {Subst}\left (\int \log \left (c x^n\right ) \, dx,x,d+e x\right )}{e} \\ & = -((b f+a g) n x)+2 b g n^2 x-\frac {2 b g n (d+e x) \log \left (c (d+e x)^n\right )}{e}+x \left (a+b \log \left (c (d+e x)^n\right )\right ) \left (f+g \log \left (c (d+e x)^n\right )\right )+\frac {d \left (b f+a g+2 b g \log \left (c (d+e x)^n\right )\right )^2}{4 b e g} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.02 (sec) , antiderivative size = 76, normalized size of antiderivative = 0.69 \[ \int \left (a+b \log \left (c (d+e x)^n\right )\right ) \left (f+g \log \left (c (d+e x)^n\right )\right ) \, dx=\frac {e (a (f-g n)+b n (-f+2 g n)) x+(a g+b (f-2 g n)) (d+e x) \log \left (c (d+e x)^n\right )+b g (d+e x) \log ^2\left (c (d+e x)^n\right )}{e} \]

[In]

Integrate[(a + b*Log[c*(d + e*x)^n])*(f + g*Log[c*(d + e*x)^n]),x]

[Out]

(e*(a*(f - g*n) + b*n*(-f + 2*g*n))*x + (a*g + b*(f - 2*g*n))*(d + e*x)*Log[c*(d + e*x)^n] + b*g*(d + e*x)*Log
[c*(d + e*x)^n]^2)/e

Maple [A] (verified)

Time = 0.40 (sec) , antiderivative size = 116, normalized size of antiderivative = 1.05

method result size
norman \(\left (2 b g \,n^{2}-a g n -b f n +a f \right ) x +\left (-2 b g n +a g +b f \right ) x \ln \left (c \,{\mathrm e}^{n \ln \left (e x +d \right )}\right )+b g x \ln \left (c \,{\mathrm e}^{n \ln \left (e x +d \right )}\right )^{2}+\frac {n \left (-2 d g b n +a d g +b d f \right ) \ln \left (e x +d \right )}{e}+\frac {d g b \ln \left (c \,{\mathrm e}^{n \ln \left (e x +d \right )}\right )^{2}}{e}\) \(116\)
parts \(x a f +\left (a g +b f \right ) \left (x \ln \left (c \left (e x +d \right )^{n}\right )-e n \left (\frac {x}{e}-\frac {d \ln \left (e x +d \right )}{e^{2}}\right )\right )+b g x \ln \left (c \,{\mathrm e}^{n \ln \left (e x +d \right )}\right )^{2}+\frac {d g b \ln \left (c \,{\mathrm e}^{n \ln \left (e x +d \right )}\right )^{2}}{e}+2 b g \,n^{2} x -\frac {2 n^{2} d g b \ln \left (e x +d \right )}{e}-2 b g n x \ln \left (c \,{\mathrm e}^{n \ln \left (e x +d \right )}\right )\) \(131\)
default \(x a f +x a g \ln \left (c \left (e x +d \right )^{n}\right )-a g n x +\frac {a g n d \ln \left (e x +d \right )}{e}+x b \ln \left (c \left (e x +d \right )^{n}\right ) f -b f n x +\frac {b f n d \ln \left (e x +d \right )}{e}+b g x \ln \left (c \,{\mathrm e}^{n \ln \left (e x +d \right )}\right )^{2}+\frac {d g b \ln \left (c \,{\mathrm e}^{n \ln \left (e x +d \right )}\right )^{2}}{e}+2 b g \,n^{2} x -\frac {2 n^{2} d g b \ln \left (e x +d \right )}{e}-2 b g n x \ln \left (c \,{\mathrm e}^{n \ln \left (e x +d \right )}\right )\) \(156\)
parallelrisch \(\frac {x \ln \left (c \left (e x +d \right )^{n}\right )^{2} b e g n -2 x \ln \left (c \left (e x +d \right )^{n}\right ) b e g \,n^{2}+2 x b e g \,n^{3}+x \ln \left (c \left (e x +d \right )^{n}\right ) a e g n +x \ln \left (c \left (e x +d \right )^{n}\right ) b e f n -x a e g \,n^{2}-x b e f \,n^{2}+\ln \left (c \left (e x +d \right )^{n}\right )^{2} b d g n -2 \ln \left (c \left (e x +d \right )^{n}\right ) b d g \,n^{2}-2 b d g \,n^{3}+x a e f n +\ln \left (c \left (e x +d \right )^{n}\right ) a d g n +\ln \left (c \left (e x +d \right )^{n}\right ) b d f n +a d g \,n^{2}+b d f \,n^{2}-a d f n}{e n}\) \(204\)
risch \(\text {Expression too large to display}\) \(1245\)

[In]

int((a+b*ln(c*(e*x+d)^n))*(f+g*ln(c*(e*x+d)^n)),x,method=_RETURNVERBOSE)

[Out]

(2*b*g*n^2-a*g*n-b*f*n+a*f)*x+(-2*b*g*n+a*g+b*f)*x*ln(c*exp(n*ln(e*x+d)))+b*g*x*ln(c*exp(n*ln(e*x+d)))^2+n*(-2
*b*d*g*n+a*d*g+b*d*f)/e*ln(e*x+d)+d*g*b/e*ln(c*exp(n*ln(e*x+d)))^2

Fricas [A] (verification not implemented)

none

Time = 0.28 (sec) , antiderivative size = 156, normalized size of antiderivative = 1.42 \[ \int \left (a+b \log \left (c (d+e x)^n\right )\right ) \left (f+g \log \left (c (d+e x)^n\right )\right ) \, dx=\frac {b e g x \log \left (c\right )^{2} + {\left (b e g n^{2} x + b d g n^{2}\right )} \log \left (e x + d\right )^{2} - {\left (2 \, b e g n - b e f - a e g\right )} x \log \left (c\right ) + {\left (2 \, b e g n^{2} + a e f - {\left (b e f + a e g\right )} n\right )} x - {\left (2 \, b d g n^{2} - {\left (b d f + a d g\right )} n + {\left (2 \, b e g n^{2} - {\left (b e f + a e g\right )} n\right )} x - 2 \, {\left (b e g n x + b d g n\right )} \log \left (c\right )\right )} \log \left (e x + d\right )}{e} \]

[In]

integrate((a+b*log(c*(e*x+d)^n))*(f+g*log(c*(e*x+d)^n)),x, algorithm="fricas")

[Out]

(b*e*g*x*log(c)^2 + (b*e*g*n^2*x + b*d*g*n^2)*log(e*x + d)^2 - (2*b*e*g*n - b*e*f - a*e*g)*x*log(c) + (2*b*e*g
*n^2 + a*e*f - (b*e*f + a*e*g)*n)*x - (2*b*d*g*n^2 - (b*d*f + a*d*g)*n + (2*b*e*g*n^2 - (b*e*f + a*e*g)*n)*x -
 2*(b*e*g*n*x + b*d*g*n)*log(c))*log(e*x + d))/e

Sympy [A] (verification not implemented)

Time = 0.30 (sec) , antiderivative size = 189, normalized size of antiderivative = 1.72 \[ \int \left (a+b \log \left (c (d+e x)^n\right )\right ) \left (f+g \log \left (c (d+e x)^n\right )\right ) \, dx=\begin {cases} \frac {a d g \log {\left (c \left (d + e x\right )^{n} \right )}}{e} + a f x - a g n x + a g x \log {\left (c \left (d + e x\right )^{n} \right )} + \frac {b d f \log {\left (c \left (d + e x\right )^{n} \right )}}{e} - \frac {2 b d g n \log {\left (c \left (d + e x\right )^{n} \right )}}{e} + \frac {b d g \log {\left (c \left (d + e x\right )^{n} \right )}^{2}}{e} - b f n x + b f x \log {\left (c \left (d + e x\right )^{n} \right )} + 2 b g n^{2} x - 2 b g n x \log {\left (c \left (d + e x\right )^{n} \right )} + b g x \log {\left (c \left (d + e x\right )^{n} \right )}^{2} & \text {for}\: e \neq 0 \\x \left (a + b \log {\left (c d^{n} \right )}\right ) \left (f + g \log {\left (c d^{n} \right )}\right ) & \text {otherwise} \end {cases} \]

[In]

integrate((a+b*ln(c*(e*x+d)**n))*(f+g*ln(c*(e*x+d)**n)),x)

[Out]

Piecewise((a*d*g*log(c*(d + e*x)**n)/e + a*f*x - a*g*n*x + a*g*x*log(c*(d + e*x)**n) + b*d*f*log(c*(d + e*x)**
n)/e - 2*b*d*g*n*log(c*(d + e*x)**n)/e + b*d*g*log(c*(d + e*x)**n)**2/e - b*f*n*x + b*f*x*log(c*(d + e*x)**n)
+ 2*b*g*n**2*x - 2*b*g*n*x*log(c*(d + e*x)**n) + b*g*x*log(c*(d + e*x)**n)**2, Ne(e, 0)), (x*(a + b*log(c*d**n
))*(f + g*log(c*d**n)), True))

Maxima [A] (verification not implemented)

none

Time = 0.21 (sec) , antiderivative size = 165, normalized size of antiderivative = 1.50 \[ \int \left (a+b \log \left (c (d+e x)^n\right )\right ) \left (f+g \log \left (c (d+e x)^n\right )\right ) \, dx=-b e f n {\left (\frac {x}{e} - \frac {d \log \left (e x + d\right )}{e^{2}}\right )} - a e g n {\left (\frac {x}{e} - \frac {d \log \left (e x + d\right )}{e^{2}}\right )} + b g x \log \left ({\left (e x + d\right )}^{n} c\right )^{2} + b f x \log \left ({\left (e x + d\right )}^{n} c\right ) + a g x \log \left ({\left (e x + d\right )}^{n} c\right ) - {\left (2 \, e n {\left (\frac {x}{e} - \frac {d \log \left (e x + d\right )}{e^{2}}\right )} \log \left ({\left (e x + d\right )}^{n} c\right ) + \frac {{\left (d \log \left (e x + d\right )^{2} - 2 \, e x + 2 \, d \log \left (e x + d\right )\right )} n^{2}}{e}\right )} b g + a f x \]

[In]

integrate((a+b*log(c*(e*x+d)^n))*(f+g*log(c*(e*x+d)^n)),x, algorithm="maxima")

[Out]

-b*e*f*n*(x/e - d*log(e*x + d)/e^2) - a*e*g*n*(x/e - d*log(e*x + d)/e^2) + b*g*x*log((e*x + d)^n*c)^2 + b*f*x*
log((e*x + d)^n*c) + a*g*x*log((e*x + d)^n*c) - (2*e*n*(x/e - d*log(e*x + d)/e^2)*log((e*x + d)^n*c) + (d*log(
e*x + d)^2 - 2*e*x + 2*d*log(e*x + d))*n^2/e)*b*g + a*f*x

Giac [A] (verification not implemented)

none

Time = 0.34 (sec) , antiderivative size = 209, normalized size of antiderivative = 1.90 \[ \int \left (a+b \log \left (c (d+e x)^n\right )\right ) \left (f+g \log \left (c (d+e x)^n\right )\right ) \, dx=\frac {{\left (e x + d\right )} b g n^{2} \log \left (e x + d\right )^{2}}{e} - \frac {2 \, {\left (e x + d\right )} b g n^{2} \log \left (e x + d\right )}{e} + \frac {2 \, {\left (e x + d\right )} b g n \log \left (e x + d\right ) \log \left (c\right )}{e} + \frac {2 \, {\left (e x + d\right )} b g n^{2}}{e} + \frac {{\left (e x + d\right )} b f n \log \left (e x + d\right )}{e} + \frac {{\left (e x + d\right )} a g n \log \left (e x + d\right )}{e} - \frac {2 \, {\left (e x + d\right )} b g n \log \left (c\right )}{e} + \frac {{\left (e x + d\right )} b g \log \left (c\right )^{2}}{e} - \frac {{\left (e x + d\right )} b f n}{e} - \frac {{\left (e x + d\right )} a g n}{e} + \frac {{\left (e x + d\right )} b f \log \left (c\right )}{e} + \frac {{\left (e x + d\right )} a g \log \left (c\right )}{e} + \frac {{\left (e x + d\right )} a f}{e} \]

[In]

integrate((a+b*log(c*(e*x+d)^n))*(f+g*log(c*(e*x+d)^n)),x, algorithm="giac")

[Out]

(e*x + d)*b*g*n^2*log(e*x + d)^2/e - 2*(e*x + d)*b*g*n^2*log(e*x + d)/e + 2*(e*x + d)*b*g*n*log(e*x + d)*log(c
)/e + 2*(e*x + d)*b*g*n^2/e + (e*x + d)*b*f*n*log(e*x + d)/e + (e*x + d)*a*g*n*log(e*x + d)/e - 2*(e*x + d)*b*
g*n*log(c)/e + (e*x + d)*b*g*log(c)^2/e - (e*x + d)*b*f*n/e - (e*x + d)*a*g*n/e + (e*x + d)*b*f*log(c)/e + (e*
x + d)*a*g*log(c)/e + (e*x + d)*a*f/e

Mupad [B] (verification not implemented)

Time = 1.34 (sec) , antiderivative size = 102, normalized size of antiderivative = 0.93 \[ \int \left (a+b \log \left (c (d+e x)^n\right )\right ) \left (f+g \log \left (c (d+e x)^n\right )\right ) \, dx={\ln \left (c\,{\left (d+e\,x\right )}^n\right )}^2\,\left (b\,g\,x+\frac {b\,d\,g}{e}\right )+x\,\left (a\,f-a\,g\,n-b\,f\,n+2\,b\,g\,n^2\right )+x\,\ln \left (c\,{\left (d+e\,x\right )}^n\right )\,\left (a\,g+b\,f-2\,b\,g\,n\right )+\frac {\ln \left (d+e\,x\right )\,\left (a\,d\,g\,n-2\,b\,d\,g\,n^2+b\,d\,f\,n\right )}{e} \]

[In]

int((a + b*log(c*(d + e*x)^n))*(f + g*log(c*(d + e*x)^n)),x)

[Out]

log(c*(d + e*x)^n)^2*(b*g*x + (b*d*g)/e) + x*(a*f - a*g*n - b*f*n + 2*b*g*n^2) + x*log(c*(d + e*x)^n)*(a*g + b
*f - 2*b*g*n) + (log(d + e*x)*(a*d*g*n - 2*b*d*g*n^2 + b*d*f*n))/e